Represents a node in a scene graph. More...
Represents a node in a scene graph.
The graph can be used whenever transformations of entities are needed.
|
virtual |
Sets the position of the node, relative to its parent.
value | The position to set. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Sets the position of the node, absolute in the world.
value | The position to use. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Translates the node, relative to its parent.
value | The offset to add. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Translates a node, absolute in the world.
value | The offset to add. |
Reimplemented in nkGraphics::Camera.
nkMaths::Vector nkGraphics::Node::getPositionRelative | ( | ) | const |
nkMaths::Vector nkGraphics::Node::getPositionAbsolute | ( | ) |
|
virtual |
Sets the orientation of a node, relative to its parent.
value | The orientation to set. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Sets the orientation of a node, absolute in the world.
value | The orientation to set. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Rotates a node, relative to its parent.
value | The offset to add. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Rotates a node, absolute in the world.
value | The offset to add. |
Reimplemented in nkGraphics::Camera.
nkMaths::Quaternion nkGraphics::Node::getOrientationRelative | ( | ) | const |
nkMaths::Quaternion nkGraphics::Node::getOrientationAbsolute | ( | ) |
|
virtual |
Sets the scale of the node, relative to its parent.
value | The scale to set. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Sets the scale of the node, absolute in the world.
value | The scale to set. |
Reimplemented in nkGraphics::Camera.
|
virtual |
Scales the node by a factor.
value | The offset to add. |
Reimplemented in nkGraphics::Camera.
nkMaths::Vector nkGraphics::Node::getScaleRelative | ( | ) | const |
nkMaths::Vector nkGraphics::Node::getScaleAbsolute | ( | ) |
void nkGraphics::Node::setRelativeTransform | ( | const nkMaths::Matrix & | value | ) |
Sets the transformation of the node, relative to its parent.
value | The transformation to set. |
void nkGraphics::Node::setAbsoluteTransform | ( | const nkMaths::Matrix & | value | ) |
Sets the absolute transformation of the node. This will set the relative transformation so that it fits the absolute transformation required.
value | The transformation to set. |
nkMaths::Matrix nkGraphics::Node::getRelativeTransform | ( | ) |
nkMaths::Matrix nkGraphics::Node::getAbsoluteTransform | ( | ) |
void nkGraphics::Node::updateTransformations | ( | ) |
Updates the transformation of a node. Used internally.
void nkGraphics::Node::dispatchDirtyTransform | ( | ) |
Dispatches a dirty transform flag to the children. Used internally.
nkMaths::Vector nkGraphics::Node::getAbsoluteUp | ( | ) |
nkMaths::Vector nkGraphics::Node::getAbsoluteFront | ( | ) |
nkMaths::Vector nkGraphics::Node::getAbsoluteRight | ( | ) |
void nkGraphics::Node::setParentNode | ( | Node * | parent | ) |
Sets the parent node for a given node. A child node will inherit all of its parent tree's transformations before applying its own.
parent | The parent node to set. Can be set to nullptr to detach the node from any parent tree. |
Node* nkGraphics::Node::getParentNode | ( | ) | const |
Node* nkGraphics::Node::getChildNode | ( | unsigned int | index | ) | const |
index | The index of the child to retrieve. |
unsigned int nkGraphics::Node::getNumChildNode | ( | ) | const |
nkMemory::StringView nkGraphics::Node::getName | ( | ) | const |
bool nkGraphics::Node::getHidden | ( | ) | const |
void nkGraphics::Node::setHidden | ( | bool | value | ) |
Sets whether the node should not export itself during a project (resource set) export. This can be used to hide programmatically generated resources from duplicating in the export.
value | Whether the node should be hidden (true) or not (false). |
void nkGraphics::Node::addEntityToTrack | ( | Entity * | entity | ) |
Tracks entity for changes. Used internally, in theory external code should not used it. Rather, see Entity::setParentNode().
void nkGraphics::Node::stopEntityTracking | ( | Entity * | entity | ) |
Stops tracking an entity for its changes. Used internally, in theory external code should not used it. Rather, see Entity::setParentNode().
unsigned int nkGraphics::Node::getTrackedEntityCount | ( | ) | const |
Entity* nkGraphics::Node::getTrackedEntity | ( | unsigned int | index | ) | const |
index | The index of the tracked entity to retrieve. |
void nkGraphics::Node::registerListener | ( | NodeChangeListener * | listener | ) |
Register a listener.
listener | The listener to register. |
void nkGraphics::Node::unregisterListener | ( | NodeChangeListener * | listener | ) |
Unregister a listener.
listener | The listener to unregister. |
|
overridevirtual |
Basic exporting capabilities.
rootNode | The tree to export to. |
Implements nkExport::Exportable.
Reimplemented in nkGraphics::Camera.
|
overridevirtual |
Basic importing capabilities.
rootNode | The tree to import from. |
Implements nkExport::Exportable.
Reimplemented in nkGraphics::Camera.